import { login } from "../../views/login/api"
const state = {
    user: {},
}
const mutations = {
    SET_USER(state, payload) {
        state.user = payload
    }
}
const actions = {
    alogin({commit}, payload) {
        return login(payload).then(res => {
            console.log(res, 'reslogin')
            if (res.data.code == 200) {
                commit("SET_USER", res.data)
            }
            return res;

        })
    }
}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}